﻿using System.ComponentModel.Composition;
using System.Windows;
using System.Windows.Input;
using Microsoft.Practices.Prism.Commands;
using Microsoft.Practices.Prism.Events;
using Microsoft.Practices.Prism.Regions;
using YunBox2.Contracts;
using YunBox2.Contracts.Core;

namespace YunBox2.Client.Infrastructure.ViewModels
{
	[Export]
	public class LogoutMenuViewModel : DomainObject
	{
		private readonly DelegateCommand _application2ExitCommand;
		private readonly DelegateCommand _userLoginDialog2ShowDialogCommand;
		private IEventAggregator _eventAggregator;
		private IRegionManager _regionManager;

		[ImportingConstructor]
		public LogoutMenuViewModel(IRegionManager regionManager, IEventAggregator eventAggregator)
		{
			_regionManager = regionManager;
			_eventAggregator = eventAggregator;

			//文件菜单命令

			_application2ExitCommand = new DelegateCommand(Application2Exit);
		}

		public ICommand Application2ExitCommand
		{
			get
			{
				return _application2ExitCommand;
			}
		}

		public ICommand UserLoginDialog2ShowDialogCommand
		{
			get
			{
				return _userLoginDialog2ShowDialogCommand;
			}
		}

		private void Application2Exit()
		{
			Application.Current.MainWindow.Close();
		}
	}
}